package com.weirong.smartvault.tools;

import com.weirong.smartvault.dao.DepartmentRepository;
import com.weirong.smartvault.entity.Department;
import org.mockito.exceptions.misusing.UnfinishedVerificationException;

import java.util.List;

import static org.mockito.Mockito.mock;

/**
 * Created by KFEB4 on 2017/11/19.
 * 用于创建MockRepository用于测试
 */
public class BuildMockRepository {
    public static DepartmentRepository departmentRepository(List<Department> departments){
        DepartmentRepository mockReposity =mock(DepartmentRepository.class);
        //when(mockReposity.findAll()).return pageable的对象，再controller中被调用
        return mockReposity;
    }
    public static List<Department> departmentsList(){
        throw new  UnfinishedVerificationException("未完成");
    }
}
